home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
batch
/
tsbat30
/
safedel.bat
< prev
next >
Wrap
DOS Batch File
|
1990-12-28
|
2KB
|
60 lines
echo off
echo.
echo ┌───────────────────────────────────────────────────┐
echo │ Safe delete of files │
echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, 28-Dec-90 │
echo └───────────────────────────────────────────────────┘
echo.
if "%1"=="" goto _help
rem Check that safedel1.bat is available at path
set _found=no
if exist safedel1.bat set _found=yes
for %%d in (%path%) do if exist %%d\safedel1.bat set _found=yes
if "%_found%"=="no" goto _err1
rem Check that ask.exe is available at path
set _found=no
if exist ask.exe set _found=yes
for %%d in (%path%) do if exist %%d\ask.exe set _found=yes
if "%_found%"=="no" goto _err2
rem Handle the files
:_loop
if not exist %1 goto _err3
rem for MsDos earlier than 3.3 move the rem below one command downwards
rem for %%f in (%1) do %comspec% /e:1024 /c safedel1 %%f
for %%f in (%1) do call safedel1 %%f
shift
if not "%1"=="" goto _loop
goto _out
:_err1
echo You must have safedel1.bat at your path (or the current directory)
goto _out
:_err2
echo You must have ask.exe at your path (or the current directory)
goto _out
:_err3
echo File(s) %1 not found
goto _out
:_help
echo Usage: SAFEDEL [FileName1] [FileName2] [FileName3] ...
echo.
echo Wildcards are allowed in the file names.
echo.
echo If you get an "Out of environment space" message, increase your
echo environment space by using shell configuration in config.sys:
echo MsDos 3.30 example: shell=c:\bin\command.com /e:1024 /p
echo.
echo To use this batch you need ask.exe and safedel1.bat either at
echo your path or the current directory.
echo.
:_out
echo on